<?php 
$attributes = array('class' => 'adminForm ', 'id' => '');
echo form_open(site_url('business/ordering'),$attributes);?>
<?php 
	$role = false;
	if(!empty($view_action)){
		if($this->current_user->group == "boss1" || $this->current_user->group == "boss2" 
			|| $this->current_user->group == "boss3"  ){
				$role = true;
	}}
?>
<table class="kunTable">
	<thead>
    	<th width="20">{{ helper:lang line="global:identifier" }}</th>
        <th width="10"><input type="checkbox" class="checkAll" /></th>
        <th>{{ helper:lang line="project:title" }}</th>
		{{if user:group != 'employee'}}
		<th width="160">{{ helper:lang line="project:user_receive" }}</th>
		{{endif}}
        <th width="130">{{ helper:lang line="project:date_start" }}</th>
		<th width="130">{{ helper:lang line="project:date_end" }}</th>
		<?php if($role == true){?>
		<th style="min-width:1px;max-width:50px"></th>
		<?php } ?>
    </thead>
    <tbody>
	{{model}}
			<tr>
            	<td>
                	{{ helper:count identifier }}
                </td>
                <td><input type="checkbox" class="checkGroup" value="{{id}}" /></td>
                <td>
					<a title="{{title}}" href="{{url:site uri='business/private/view/{{id}}'}}" class="bg-user">{{text:clear value = title length = '30' }}</a>
				</td>
				{{if user:group != 'employee'}}
				<td class="cpt">{{display_name}}</td>
				{{endif}}
                <td class="tc">{{ helper:date format = 'd-m-Y H:i' timestamp = date_start }}</td>
				<td class="tc">{{ helper:date format = 'd-m-Y H:i' timestamp = date_end }}</td>
				<?php if($role == true){?>
				<td>
					{{button:href: class="edit" title={helper:lang line="global:edit"} data-toggle="tooltip" 
                    		href={url:site uri="business/edit/{{id}}"} }}
                    {{button:href: class="del" title={ helper:lang line="global:delete"} data-toggle="tooltip" 
                    		href={url:site uri="business/delete/{{id}}"} }}
				</td>
				<?php } ?>
            </tr>
	{{/model}}
	</tbody>
</table>	

<script type="text/javascript">
//$('.dataFitter').dataTable();
$('.tooltips').tooltip();
$('.checkAll').on('click', function () {
$(this).closest('table').find('.checkGroup').prop('checked', this.checked);
}); 
</script>
